<template>
  <el-container class="mian-container">
  <el-header>
    <img src="../assets/images/logo.png" alt="">
    <el-menu mode="horizontal"
        background-color="#23262e"
        text-color="#fff"
        active-text-color="#409eff">
    <el-submenu index="2">
    <template slot="title">

      个人中心</template>
    <el-menu-item index="2-1">选项1</el-menu-item>
    <el-menu-item index="2-2">选项2</el-menu-item>
    <el-menu-item index="2-3">选项3</el-menu-item>
    </el-submenu>
     <el-menu-item index="1">退出</el-menu-item>
    </el-menu>
  </el-header>
  <el-container>
  <el-aside width="200px">
    <div class="user-info">
      <img src="../assets/logo.png" alt="" class="avatar">
      <span>欢迎你</span>
    </div>
  <el-menu class="aside-menu"
        background-color="#23262e"
        text-color="#fff"
        active-text-color="#409eff"
        unique-opened>
  <el-menu-item index="2">
        <i class="el-icon-menu"></i>
        <span slot="title">首页</span>
  </el-menu-item>
  <el-submenu index="2">
    <template slot="title">文章管理</template>
    <el-menu-item index="2-1">选项1</el-menu-item>
    <el-menu-item index="2-2">选项2</el-menu-item>
    </el-submenu>
    <el-submenu index="3">
    <template slot="title">个人中心</template>
    <el-menu-item index="3-1">选项1</el-menu-item>
    <el-menu-item index="3-2">选项2</el-menu-item>
    <el-menu-item index="3-3">选项3</el-menu-item>
    </el-submenu>
  </el-menu>
  </el-aside>
    <el-container>
      <el-main>Main</el-main>
      <el-footer>Footer</el-footer>
    </el-container>
  </el-container>
</el-container>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.$store.dispatch('user/getUser')
  },
  computed: {
    ...mapState('user', ['user'])
  }
}
</script>
<style lang="less">
.mian-container {
height: 100%;
.el-header,.el-aside {
  background-color: #23262e;
}
.el-aside {
  background-color: #23262e;
}
.el-main {
  background-color: #f2f2f2;
}
.el-footer {
  background-color: #eee;
}
.el-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.aside-menu {
  width: 200px;
}
.avatar {
width: 35px;
  height: 35px;
  background-color: #fff;
  border-radius: 50%;
  margin-right: 15px;
}
.user-info {
  height: 70px;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
}
}

</style>
